package com.example.IoCpractice.Controller;

import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2025-01-13
 * Time: 16:34
 */
@RestController
public class YmlController {
    /*@Value("${spring.datasource.url}")
    private String url;

    @Value("${spring.datasource.username}")
    private String username;

    @Value("${yml.value}")
    private String ymlValue;*/

    @Value("${string.str1}")
    private String str1;

    @Value("${string.str2}")
    private String str2;

    @Value("${string.str3}")
    private String str3;

    @PostConstruct
    public void ymlread() {
        /*System.out.println("yml配置文件url: " + url);
        System.out.println("yml配置文件username: " + username);
        System.out.println("yml配置文件username: " + ymlValue);*/
        System.out.println("yml配置文件str1: " + str1);
        System.out.println("yml配置文件str2: " + str2);
        System.out.println("yml配置文件str3: " + str3);
    }
}
